In a distributed system, data is shared by processes distributed to multiple service execution nodes. If a process needs to perform an operation on any resource, the process needs to obtain a lock in advance. Control of concurrent access of different processes is implemented by a global lock manager, and the global lock manager records a situation of accessing a resource and holding a lock by each process, and maintains a lock request waiting queue. When receiving a lock request, the global lock manager determines, according to a lock type, lock compatibility, and a state of whether a lock is held, whether to satisfy the lock request.
In an existing lock management system, a collaboration technology of a global lock manager and a node lock manager is adopted. In a service execution node, each system instance has a node lock manager, and a process managed by each system instance shares a lock manager. After a process corresponding to a system instance has a lock request, the lock request is first sent to a node lock manager; and if the node lock manager can handle the lock request, the node lock manager returns a lock to the process that requests the lock, and if the node lock manager cannot handle the lock request, the node lock manager sends the lock request to a global lock manager, and the global lock manager handles the lock request.
In a process of implementing the foregoing lock management system, the number of levels of the lock management system in the lock management system in the prior art is determined during program development. When a large number of lock access requests occur in the system, a lock access delay is relatively high, and system running performance cannot be ensured.